#include<stdio.h>
#include<unistd.h>
#include<stdlib.h>
#include<errno.h>
#include<string.h>
#include<signal.h>
int main(int argc,char **argv)
{
	pid_t       pid;

	if((pid = fork()<0))
		printf("fork1 error:%s\n",strerror(errno));

	else if(pid != 0)
	{
		sleep(2);
		exit(2);
	}

	if((pid = fork()<0))
		printf("fork2 error:%s\n",strerror(errno));

	else if(pid != 0)
	{
		sleep(4);
		abort;
	}
    
    if((pid = fork()<0))
		printf("fork3 error:%s\n",strerror(errno));

	else if(pid != 0)
	{
		execl("/bin/dd","dd","if=/etc/passwd","of=/dev/null",NULL);
		exit(7);
	}


    if((pid = fork()<0))
		printf("fork4 error:%s\n",strerror(errno));

	else if(pid != 0)
	{
		sleep(8);
		exit(0);
	}

	sleep(6);

	kill(getpid(),SIGKILL);

	exit(6);

}
